package idv.ccApp.cwFileExplore;

import android.app.Activity;
import android.content.Context;
import android.graphics.Matrix;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;

/**
 * Created with IntelliJ IDEA.
 * User: cc.cheng
 * Date: 2013/6/19
 * Time: 下午 6:06
 * To change this template use File | Settings | File Templates.
 */
public class myUtilClass {
  final static String TAG="myUtilClass";

  public static DisplayMetrics getDisplayMatrix(Context ctx){
    DisplayMetrics metrics = new DisplayMetrics();
    ((Activity)ctx).getWindowManager().getDefaultDisplay().getMetrics(metrics);
    return metrics;
  }

  public static void switchFulllScreen(Context ctx, boolean set){
    if(set==true){
      //((Activity)ctx).getActionBar().hide();
      ((Activity)ctx).requestWindowFeature(Window.FEATURE_NO_TITLE);
      ((Activity)ctx).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
      //((Activity)ctx).getActionBar().show();
    }
  }

  public static void MyTRACE() {
    MyTRACE("", 2);
  }
  public static void MyTRACE(String msg) {
    MyTRACE("\n\t" + msg, 2);
  }
  public static void MyTRACE(String msg, int lv) {
    //int level = lv;
    Throwable th = new Throwable();
    Log.d(TAG, th.getStackTrace()[lv].toString() + ":\n\t" + msg);
  }
}

//}
